['1', '2', '3'].reduce((arr, text) => {
  const newArr = [...arr];
  newArr.push(text);
  return newArr;
}, [] as readonly string[]);

[1, 2, 3].reduce((arr, num) => arr.concat(num * 2), [] as number[]);

['a', 'b'].reduce(
  (accum, name) => ({
    ...accum,
    [name]: true,
  }),
  {} as Record<string, boolean>,
);

declare const arr: string[];
arr.reduce<string>(acc => acc, arr.shift() as string);

[1, 2, 3].reduce((a, s) => a.concat(s * 2), [] as number[]);

[1, 2, 3].reduce((a, s) => a.concat(s * 2), <number[]>[]);

[1, 2, 3]?.reduce((a, s) => a.concat(s * 2), [] as number[]);

[1, 2, 3]?.reduce((a, s) => a.concat(s * 2), <number[]>[]);

const names = ['a', 'b', 'c'];
names.reduce(
  (accum, name) => ({
    ...accum,
    [name]: true,
  }),
  {} as Record<string, boolean>,
);

['a', 'b'].reduce(
  (accum, name) => ({
    ...accum,
    [name]: true,
  }),
  <Record<string, boolean>>{},
);

function f<T, U extends T[]>(a: U) {
  return a.reduce(() => {}, {} as Record<string, boolean>);
}